<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>定位机制-1</title>
    <style>
        .box{
            width: 100px;
            height: 100px;
            background-color: greenyellow;
            margin-bottom: 10px;
            text-align: center;
            line-height: 100px;
        }

        .box1{
            position: relative;  /*relative ： 相对定位；absolute：绝对定位*/
            left: 300px;/*left right top bottom*/
            top: 200px;
        }


        .box2{
            position: absolute;  /*relative ： 相对定位；absolute：绝对定位*/
            left: 300px;/*left right top bottom*/
            top:100px;
        }

        .box3{
            position: relative;  /*relative ： 相对定位；absolute：绝对定位*/
            left: 300px;/*left right top bottom*/
            /*top: 200px;*/
        }


        .container{
            position: relative;
            width: 600px;
            height: 300px;
            border: 1px solid;

            left: 200px;
        }

        .outer{
            position: relative;
            top: 50px;
        }
    </style>
</head>
<body>
<div class="outer">
    <div class="container">
        <div class="box">1</div>
        <div class="box box2">2</div>
        <div class="box ">3</div>

    </div>

</div>



</body>
</html>